
import 'package:flutter/material.dart';

class DetailPage extends StatelessWidget{
  const DetailPage({super.key});
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('DetailPage'),
        ),
       body:  Center(
         child: Column(
          children: [
            const Text('DetailPage'),
            ElevatedButton(
              onPressed: (){
                //返回上一页
                Navigator.pop(context);
              },
              child: const Text('返回'),
            ),
            ElevatedButton(
              onPressed: (){
                //点击弹窗
         showDialog(context: context, builder: (context){
           return AlertDialog(
             title: const Text('弹窗'),
             content: const Text('这是一个弹窗'),
             actions: [
               ElevatedButton(
          onPressed: (){
            //点击弹窗
            Navigator.pop(context);
          },
          child: const Text('确定'),
               ),
             ],
           );
         });
              },
              child: const Text('点击弹窗'),
            ),
          ],
         ),
       )
      );
  }
}